/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 * Description: mc2 profiling
 * Author: huawei
 * Create: 2024-05-24
 */

#ifndef ASCEND_ACE_COMOP_HCCL_HCCL_AI_CPU_KERNEL_DFX_PROFILING_PROFILING_EXTEND_INFO_H_
#define ASCEND_ACE_COMOP_HCCL_HCCL_AI_CPU_KERNEL_DFX_PROFILING_PROFILING_EXTEND_INFO_H_
#include "hccl/base.h"
#include "toolchain/prof_common.h"
class SqeInfo;
class AicpuComContext;
namespace dfx {
constexpr u32 AC_MAX_RANK_NUM = 32U;
struct ProfilingExtendInfo {
    uint16_t lastSqeIdxs[AC_MAX_RANK_NUM];
};

class ProfilingExtendInfoHelper {
    using Handle = void (*)(const SqeInfo &sqeInfo, MsprofAicpuHcclTaskInfo &msprofAicpuMC2HcclInfo);

public:
    static void Init(const AicpuComContext *ctx);
    static void SqeInfo2MsprofAicpuMC2HcclInfo(const SqeInfo &sqeInfo, MsprofAicpuHcclTaskInfo &msprofAicpuMC2HcclInfo);
    static void Ctx2MsprofAicpuMC2HcclInfo(const AicpuComContext *ctx, MsprofAicpuHcclTaskInfo &msprofAicpuMC2HcclInfo);
    static std::string MsprofAicpuMC2HcclInfoToString(const MsprofAicpuHcclTaskInfo &msprofAicpuMC2HcclInfo);
    static std::string AicpuKfcProfCommTurnToString(const AicpuKfcProfCommTurn &aicpuKfcProfCommTurn);
    static void InitProfItemId();
    static void InitHcclInfo(MsprofAicpuHcclTaskInfo &msprofAicpuMC2HcclInfo);
private:
    static void AssembleProfInfoByType(const SqeInfo &sqeInfo, MsprofAicpuHcclTaskInfo &msprofAicpuMC2HcclInfo);
};
}  // namespace dfx
#endif  // ASCEND_ACE_COMOP_HCCL_HCCL_AI_CPU_KERNEL_DFX_PROFILING_PROFILING_EXTEND_INFO_H_
